// sum of digits

# include <iostream.h>
# include <conio.h>

class DigitSum {
  int number;
public:
  void getNumber();
  void printDigitSum();
};

void DigitSum::getNumber() {
  cout << "Enter the number: ";
  cin >> number;
}

void DigitSum::printDigitSum() {
  int temp = 0;
  while(number) {
    temp += number%10;
    number /= 10;
  }
  cout << temp;
}

void main() {
  clrscr();
  DigitSum ds;
  ds.getNumber();
  ds.printDigitSum();
  getch();
}